home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectSound / EffectsBuffers / frmCompressor.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-08  |  7.9 KB  |  265 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmCompressor 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Compressor Effects Update"
  6.    ClientHeight    =   2145
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   5550
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2145
  14.    ScaleWidth      =   5550
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.CommandButton cmdOK 
  18.       Caption         =   "OK"
  19.       Height          =   315
  20.       Left            =   4560
  21.       TabIndex        =   12
  22.       Top             =   1680
  23.       Width           =   915
  24.    End
  25.    Begin MSComctlLib.Slider sldAttack 
  26.       Height          =   195
  27.       Left            =   60
  28.       TabIndex        =   0
  29.       Top             =   300
  30.       Width           =   2655
  31.       _ExtentX        =   4683
  32.       _ExtentY        =   344
  33.       _Version        =   393216
  34.       LargeChange     =   10
  35.       SmallChange     =   5
  36.       Min             =   1
  37.       Max             =   500
  38.       SelStart        =   1
  39.       TickFrequency   =   33
  40.       Value           =   1
  41.    End
  42.    Begin MSComctlLib.Slider sldOutputGain 
  43.       Height          =   195
  44.       Left            =   60
  45.       TabIndex        =   1
  46.       Top             =   840
  47.       Width           =   2655
  48.       _ExtentX        =   4683
  49.       _ExtentY        =   344
  50.       _Version        =   393216
  51.       LargeChange     =   10
  52.       SmallChange     =   2
  53.       Min             =   -60
  54.       Max             =   60
  55.       TickFrequency   =   10
  56.    End
  57.    Begin MSComctlLib.Slider sldDelay 
  58.       Height          =   195
  59.       Left            =   60
  60.       TabIndex        =   2
  61.       Top             =   1380
  62.       Width           =   2655
  63.       _ExtentX        =   4683
  64.       _ExtentY        =   344
  65.       _Version        =   393216
  66.       LargeChange     =   1
  67.       Max             =   4
  68.    End
  69.    Begin MSComctlLib.Slider sldRatio 
  70.       Height          =   195
  71.       Left            =   2820
  72.       TabIndex        =   3
  73.       Top             =   840
  74.       Width           =   2655
  75.       _ExtentX        =   4683
  76.       _ExtentY        =   344
  77.       _Version        =   393216
  78.       LargeChange     =   10
  79.       Min             =   1
  80.       Max             =   100
  81.       SelStart        =   1
  82.       TickFrequency   =   10
  83.       Value           =   1
  84.    End
  85.    Begin MSComctlLib.Slider sldRelease 
  86.       Height          =   195
  87.       Left            =   2835
  88.       TabIndex        =   4
  89.       Top             =   1365
  90.       Width           =   2655
  91.       _ExtentX        =   4683
  92.       _ExtentY        =   344
  93.       _Version        =   393216
  94.       LargeChange     =   10
  95.       SmallChange     =   5
  96.       Min             =   50
  97.       Max             =   3000
  98.       SelStart        =   50
  99.       TickFrequency   =   100
  100.       Value           =   50
  101.    End
  102.    Begin MSComctlLib.Slider sldThreshold 
  103.       Height          =   195
  104.       Left            =   2820
  105.       TabIndex        =   10
  106.       Top             =   300
  107.       Width           =   2655
  108.       _ExtentX        =   4683
  109.       _ExtentY        =   344
  110.       _Version        =   393216
  111.       LargeChange     =   10
  112.       Min             =   -60
  113.       Max             =   0
  114.       TickFrequency   =   5
  115.    End
  116.    Begin VB.Label lbl 
  117.       BackStyle       =   0  'Transparent
  118.       Caption         =   "Threshold"
  119.       Height          =   255
  120.       Index           =   8
  121.       Left            =   2820
  122.       TabIndex        =   11
  123.       Top             =   60
  124.       Width           =   735
  125.    End
  126.    Begin VB.Label lbl 
  127.       BackStyle       =   0  'Transparent
  128.       Caption         =   "Ratio"
  129.       Height          =   255
  130.       Index           =   4
  131.       Left            =   2820
  132.       TabIndex        =   9
  133.       Top             =   600
  134.       Width           =   1035
  135.    End
  136.    Begin VB.Label lbl 
  137.       BackStyle       =   0  'Transparent
  138.       Caption         =   "Pre-Delay"
  139.       Height          =   255
  140.       Index           =   3
  141.       Left            =   60
  142.       TabIndex        =   8
  143.       Top             =   1140
  144.       Width           =   1035
  145.    End
  146.    Begin VB.Label lbl 
  147.       BackStyle       =   0  'Transparent
  148.       Caption         =   "Gain"
  149.       Height          =   255
  150.       Index           =   0
  151.       Left            =   60
  152.       TabIndex        =   7
  153.       Top             =   600
  154.       Width           =   1215
  155.    End
  156.    Begin VB.Label lbl 
  157.       BackStyle       =   0  'Transparent
  158.       Caption         =   "Attack"
  159.       Height          =   255
  160.       Index           =   1
  161.       Left            =   60
  162.       TabIndex        =   6
  163.       Top             =   60
  164.       Width           =   735
  165.    End
  166.    Begin VB.Label lbl 
  167.       BackStyle       =   0  'Transparent
  168.       Caption         =   "Release"
  169.       Height          =   255
  170.       Index           =   2
  171.       Left            =   2835
  172.       TabIndex        =   5
  173.       Top             =   1125
  174.       Width           =   1035
  175.    End
  176. Attribute VB_Name = "frmCompressor"
  177. Attribute VB_GlobalNameSpace = False
  178. Attribute VB_Creatable = False
  179. Attribute VB_PredeclaredId = True
  180. Attribute VB_Exposed = False
  181. Option Explicit
  182. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  183. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  184. '  File:       frmCompressor.frm
  185. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  186. Private oBuffer As DirectSoundSecondaryBuffer8
  187. Private mlIndex As Long
  188. Private oFX As DirectSoundFXCompressor8
  189. Private Sub SaveAllSettings()
  190.     Dim fxNew As DSFXCOMPRESSOR
  191.     'Ok, save these new settings
  192.     'Set the new information up
  193.     With fxNew
  194.         .fAttack = CSng(sldAttack.Value)
  195.         .fGain = CSng(sldOutputGain.Value)
  196.         .fPredelay = CSng(sldDelay.Value)
  197.         .fRatio = CSng(sldRatio.Value)
  198.         .fRelease = CSng(sldRelease.Value)
  199.         .fThreshold = CSng(sldThreshold.Value)
  200.     End With
  201.     'Now update the effect
  202.     oFX.SetAllParameters fxNew
  203. End Sub
  204. Private Sub cmdOK_Click()
  205.     SaveAllSettings
  206.     Unload Me
  207. End Sub
  208. Private Sub Form_Load()
  209.     Dim fxCurrent As DSFXCOMPRESSOR
  210.     'Get the echo interface
  211.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_COMPRESSOR, mlIndex, IID_DirectSoundFXCompressor)
  212.     'Get the current settings from it
  213.     fxCurrent = oFX.GetAllParameters
  214.     'Now put them out there
  215.     With fxCurrent
  216.         sldAttack.Value = CLng(.fAttack)
  217.         sldOutputGain.Value = CLng(.fGain)
  218.         sldDelay.Value = CLng(.fPredelay)
  219.         sldRatio.Value = CLng(.fRatio)
  220.         sldRelease.Value = CLng(.fRelease)
  221.         sldThreshold.Value = CLng(.fThreshold)
  222.     End With
  223. End Sub
  224. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  225.     'Store the buffer and index
  226.     Set oBuffer = oBuf
  227.     mlIndex = Index
  228. End Sub
  229. Private Sub sldAttack_Change()
  230.     SaveAllSettings
  231. End Sub
  232. Private Sub sldAttack_Scroll()
  233.     SaveAllSettings
  234. End Sub
  235. Private Sub sldDelay_Change()
  236.     SaveAllSettings
  237. End Sub
  238. Private Sub sldDelay_Scroll()
  239.     SaveAllSettings
  240. End Sub
  241. Private Sub sldOutputGain_Change()
  242.     SaveAllSettings
  243. End Sub
  244. Private Sub sldOutputGain_Scroll()
  245.     SaveAllSettings
  246. End Sub
  247. Private Sub sldRatio_Change()
  248.     SaveAllSettings
  249. End Sub
  250. Private Sub sldRatio_Scroll()
  251.     SaveAllSettings
  252. End Sub
  253. Private Sub sldRelease_Change()
  254.     SaveAllSettings
  255. End Sub
  256. Private Sub sldRelease_Scroll()
  257.     SaveAllSettings
  258. End Sub
  259. Private Sub sldThreshold_Change()
  260.     SaveAllSettings
  261. End Sub
  262. Private Sub sldThreshold_Scroll()
  263.     SaveAllSettings
  264. End Sub
  265.